home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Extras / IFF / IFF_Forms / WORD.doc < prev    next >
Encoding:
Text File  |  1993-03-01  |  6.9 KB  |  243 lines

  1. ProWrite document format (New Horizons)
  2.  
  3. TITLE:  WORD  (word processing FORM used by ProWrite)
  4.  
  5. IFF FORM / CHUNK DESCRIPTION
  6. ============================
  7.  
  8. Form/Chunk IDs:
  9.    FORM   WORD
  10.    Chunks FONT,COLR,DOC,HEAD,FOOT,PCTS,PARA,TABS,PAGE,TEXT,FSCC,PINF
  11.  
  12. Date Submitted: 03/87
  13. Submitted by:   James Bayless - New Horizons Software, Inc.
  14.  
  15.  
  16. FORM
  17. ====
  18.  
  19. FORM ID:  WORD
  20.  
  21. FORM Purpose:  Document storage (supports color, fonts, pictures)
  22.  
  23. FORM Description:
  24.  
  25. This include file describes FORM WORD and its Chunks
  26.  
  27. /*
  28.  *      IFF Form WORD structures and defines
  29.  *      Copyright (c) 1987 New Horizons Software, Inc.
  30.  *
  31.  *      Permission is hereby granted to use this file in any and all
  32.  *      applications.  Modifying the structures or defines included
  33.  *      in this file is not permitted without written consent of
  34.  *      New Horizons Software, Inc.
  35.  */
  36.  
  37. #include ":IFF/ILBM.h"        /* Makes use of ILBM defines */
  38.  
  39. #define ID_WORD      MakeID('W','O','R','D')      /* Form type */
  40.  
  41. #define ID_FONT      MakeID('F','O','N','T')      /* Chunks */
  42. #define ID_COLR      MakeID('C','O','L','R')
  43. #define ID_DOC       MakeID('D','O','C',' ')
  44. #define ID_HEAD      MakeID('H','E','A','D')
  45. #define ID_FOOT      MakeID('F','O','O','T')
  46. #define ID_PCTS      MakeID('P','C','T','S')
  47. #define ID_PARA      MakeID('P','A','R','A')
  48. #define ID_TABS      MakeID('T','A','B','S')
  49. #define ID_PAGE      MakeID('P','A','G','E')
  50. #define ID_TEXT      MakeID('T','E','X','T')
  51. #define ID_FSCC      MakeID('F','S','C','C')
  52. #define ID_PINF      MakeID('P','I','N','F')
  53.  
  54. /*
  55.  *   Special text characters for page number, date, and time
  56.  *   Note:  ProWrite currently supports only PAGENUM_CHAR, and only in
  57.  *      headers and footers
  58.  */
  59.  
  60. #define PAGENUM_CHAR   0x80
  61. #define DATE_CHAR      0x81
  62. #define TIME_CHAR      0x82
  63.  
  64. /*
  65.  *   Chunk structures follow
  66.  */
  67.  
  68. /*
  69.  *   FONT - Font name/number table
  70.  *   There are one of these for each font/size combination
  71.  *   These chunks should appear at the top of the file (before document data)
  72.  */
  73.  
  74. typedef struct {
  75.    UBYTE   Num;         /* 0 .. 255 */
  76.    UWORD   Size;
  77. /* UBYTE   Name[];      */   /* NULL terminated, without ".font" */
  78. } FontID;
  79.  
  80. /*
  81.  *   COLR - Color translation table
  82.  *   Translates from color numbers used in file to ISO color numbers
  83.  *   Should be at top of file (before document data)
  84.  *   Note:  Currently ProWrite only checks these values to be its current map,
  85.  *      it does no translation as it does for FONT chunks
  86.  */
  87.  
  88. typedef struct {
  89.    UBYTE   ISOColors[8];
  90. } ISOColors;
  91.  
  92. /*
  93.  *   DOC - Begin document section
  94.  *   All text and paragraph formatting following this chunk and up to a
  95.  *   HEAD, FOOT, or PICT chunk belong to the document section
  96.  */
  97.  
  98. #define PAGESTYLE_1   0      /* 1, 2, 3 */
  99. #define PAGESTYLE_I   1      /* I, II, III */
  100. #define PAGESTYLE_i   2      /* i, ii, iii */
  101. #define PAGESTYLE_A   3      /* A, B, C */
  102. #define PAGESTYLE_a   4      /* a, b, c */
  103.  
  104. typedef struct {
  105.    UWORD   StartPage;      /* Starting page number */
  106.    UBYTE   PageNumStyle;   /* From defines above */
  107.    UBYTE   pad1;
  108.    LONG    pad2;
  109. } DocHdr;
  110.  
  111. /*
  112.  *   HEAD/FOOT - Begin header/footer section
  113.  *   All text and paragraph formatting following this chunk and up to a
  114.  *   DOC, HEAD, FOOT, or PICT chunk belong to this header/footer
  115.  *   Note:  This format supports multiple headers and footers, but currently
  116.  *      ProWrite only allows a single header and footer per document
  117.  */
  118.  
  119. #define PAGES_NONE   0
  120. #define PAGES_LEFT   1
  121. #define PAGES_RIGHT  2
  122. #define PAGES_BOTH   3
  123.  
  124. typedef struct {
  125.    UBYTE   PageType;       /* From defines above */
  126.    UBYTE   FirstPage;      /* 0 = Not on first page */
  127.    LONG   pad;
  128. } HeadHdr;
  129.  
  130. /*
  131.  *   PCTS - Begin picture section
  132.  *   Note:  ProWrite currently requires NPlanes to be three (3)
  133.  */
  134.  
  135. typedef struct {
  136.    UBYTE   NPlanes;      /* Number of planes used in picture bitmaps */
  137.    UBYTE   pad;
  138. } PictHdr;
  139.  
  140. /*
  141.  *   PARA - New paragraph format
  142.  *   This chunk should be inserted first when a new section is started (DOC,
  143.  *      HEAD, or FOOT), and again whenever the paragraph format changes
  144.  */
  145.  
  146. #define SPACE_SINGLE   0
  147. #define SPACE_DOUBLE   0x10
  148.  
  149. #define JUSTIFY_LEFT    0
  150. #define JUSTIFY_CENTER  1
  151. #define JUSTIFY_RIGHT   2
  152. #define JUSTIFY_FULL    3
  153.  
  154. #define MISCSTYLE_NONE   0
  155. #define MISCSTYLE_SUPER  1      /* Superscript */
  156. #define MISCSTYLE_SUB    2      /* Subscript */
  157.  
  158. typedef struct {
  159.    UWORD   LeftIndent;    /* In decipoints (720 dpi) */
  160.    UWORD   LeftMargin;
  161.    UWORD   RightMargin;
  162.    UBYTE   Spacing;       /* From defines above */
  163.    UBYTE   Justify;       /* From defines above */
  164.    UBYTE   FontNum;       /* FontNum, Style, etc. for first char in para*/
  165.    UBYTE   Style;         /* Standard Amiga style bits */
  166.    UBYTE   MiscStyle;     /* From defines above */
  167.    UBYTE   Color;         /* Internal number, use COLR to translate */
  168.    LONG    pad;
  169. } ParaFormat;
  170.  
  171. /*
  172.  *   TABS - New tab stop types/locations
  173.  *   Use an array of values in each chunk
  174.  *   Like the PARA chunk, this should be inserted whenever the tab settings
  175.  *      for a paragraph change
  176.  *   Note:  ProWrite currently does not support TAB_CENTER
  177.  */
  178.  
  179. #define TAB_LEFT     0
  180. #define TAB_CENTER   1
  181. #define TAB_RIGHT    2
  182. #define TAB_DECIMAL  3
  183.  
  184. typedef struct {
  185.    UWORD   Position;      /* In decipoints */
  186.    UBYTE   Type;
  187.    UBYTE   pad;
  188. } TabStop;
  189.  
  190. /*
  191.  *   PAGE - Page break
  192.  *   Just a marker -- this chunk has no data
  193.  */
  194.  
  195. /*
  196.  *   TEXT - Paragraph text (one block per paragraph)
  197.  *   Block is actual text, no need for separate structure
  198.  *   If the paragraph is empty, this is an empty chunk -- there MUST be
  199.  *   a TEXT block for every paragraph
  200.  *   Note:  The only ctrl characters ProWrite can currently handle in TEXT
  201.  *   chunks are Tab and PAGENUM_CHAR, ie no Return's, etc.
  202.  */
  203.  
  204. /*
  205.  *   FSCC - Font/Style/Color changes in previous TEXT block
  206.  *   Use an array of values in each chunk
  207.  *   Only include this chunk if the previous TEXT block did not have
  208.  *      the same Font/Style/Color for all its characters
  209.  */
  210.  
  211. typedef struct {
  212.    UWORD   Location;      /* Character location in TEXT chunk of change */
  213.    UBYTE   FontNum;
  214.    UBYTE   Style;
  215.    UBYTE   MiscStyle;
  216.    UBYTE   Color;
  217.    UWORD   pad;
  218. } FSCChange;
  219.  
  220. /*
  221.  *   PINF - Picture info
  222.  *   This chunk must only be in a PCTS section
  223.  *   Must be followed by ILBM BODY chunk
  224.  *   Pictures are treated independently of the document text (like a
  225.  *      page-layout system), this chunk includes information about what
  226.  *      page and location on the page the picture is at
  227.  *   Note:  ProWrite currently only supports mskTransparentColor and
  228.  *      mskHasMask masking
  229.  */
  230.  
  231. typedef struct {
  232.    UWORD         Width, Height;   /* In pixels */
  233.    UWORD         Page;         /* Which page picture is on (0..max) */
  234.    UWORD         XPos, YPos;      /* Location on page in decipoints */
  235.    Masking       Masking;      /* Like ILBM format */
  236.    Compression   Compression;   /* Like ILBM format */
  237.    UBYTE         TransparentColor;   /* Like ILBM format */
  238.    UBYTE         pad;
  239. } PictInfo;
  240.  
  241. /* end */
  242.  
  243.